#ifndef STATISTICFIELDDIALOG_H
#define STATISTICFIELDDIALOG_H

#include <QDialog>

#include <QStandardItem>
#include <QStandardItemModel>
#include <QComboBox>
#include <QFormLayout>
#include <QLabel>
#include <QWebEngineView>
#include <QWebEnginePage>
#include <QWebEngineHttpRequest>

#include <QFile>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <QFileDialog>
#include <QHBoxLayout>
#include <QUrl>
#include <QSplitter>

#include "src/Geo/map/geomap.h"
#include "src/Geo/map/geolayer.h"
#include "src/Geo/map/geofielddefn.h"
#include "src/util/env.h"

namespace Ui {
class StatisticFieldDialog;
}

class StatisticFieldDialog : public QDialog
{
    Q_OBJECT

public:
    //explicit StatisticFieldDialog(QWidget *parent = nullptr);
    StatisticFieldDialog(GeoMap *mapIn,QWidget *parent=Q_NULLPTR);
    ~StatisticFieldDialog();

public:
    void iniMainWindow();
    QMap<QString,int> getKindMap(QString featureLayer,QString field);

private slots:
    void on_comboCurLayer_currentIndexChanged(int index);
    void on_comboCurField_currentIndexChanged(int index);
    void on_ResizeEcharts();


protected:
    virtual void resizeEvent(QResizeEvent *event) override;
private:
    GeoMap *map;
    GeoFeatureLayer *curFeatureLayer;

    QComboBox *comboCurLayer;
    QComboBox *comboCurField;
    QFrame *leftFrame;
    QFormLayout *formLayout;
    QWebEngineView *pEngViewBar;
    QJsonArray dataLine;				//传入Json数据

    bool isLoaded;
private:
    Ui::StatisticFieldDialog *ui;
};

#endif // STATISTICFIELDDIALOG_H
